import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:online_study/base/app_title.dart';
import 'package:online_study/mine/answer/answer_result.dart';
import 'package:online_study/theme/colors.dart';
import 'package:online_study/theme/size.dart';

//答题记录
class AnswerHistoryPage extends StatefulWidget {
  @override
  _AnswerHistoryPageState createState() => _AnswerHistoryPageState();
}

class _AnswerHistoryPageState extends State<AnswerHistoryPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: BackButton(color: ThemeColor.color333333),
        titleSpacing: 0,
        backgroundColor: ThemeColor.colorWhite,
        elevation: ThemeSize.appElevation,
        title: AppTitle("答题记录"),
      ),
      body: ListView.separated(
          itemBuilder: (BuildContext context, int index) {
            return Container(
              color: ThemeColor.colorWhite,
              width: double.infinity,
              padding: EdgeInsets.symmetric(horizontal: ThemeSize.width19),
              height: ThemeSize.height48,
              child: Row(
                children: [
                  Expanded(
                      child: Text("2021-03-28",
                          style: TextStyle(
                              color: ThemeColor.color555555,
                              fontSize: ThemeSize.sp13))),
                  GestureDetector(
                    child: Container(
                      alignment: Alignment.center,
                      height: ThemeSize.height48,
                      child: Row(
                        children: [
                          Text(
                            "详情",
                            style: TextStyle(
                                color: ThemeColor.color1485EE,
                                fontSize: ThemeSize.sp12),
                          ),
                          Container(
                              margin: EdgeInsets.only(left: ThemeSize.width9),
                              child: Icon(
                                  const IconData(0xe631,
                                      fontFamily: 'IconFonts'),
                                  size: ThemeSize.height12))
                        ],
                      ),
                    ),
                    onTap: () {
                      Get.to(() => AnswerResultPage());
                    },
                  )
                ],
              ),
            );
          },
          separatorBuilder: (BuildContext context, int index) {
            return Divider(height: ThemeSize.width1);
          },
          itemCount: 7),
    );
  }
}
